package ma.myschool.app.dao.hibernate;

import java.util.List;

import ma.myschool.app.dao.PaiementHistoryDao;
import ma.myschool.app.model.PaiementHistory;

import org.springframework.stereotype.Repository;


/**
 * This class interacts with hibernate session to save/delete and
 * retrieve Role objects.
 *
 * @author <a href="mailto:bwnoll@gmail.com">Bryan Noll</a>
 * @author jgarcia (updated to hibernate 4)
 */
@Repository
public class PaiementHistoryDaoHibernate extends GenericDaoHibernate<PaiementHistory, Long> implements PaiementHistoryDao {

    /**
     * Constructor to create a Generics-based version using Role as the entity
     */
    public PaiementHistoryDaoHibernate() {
        super(PaiementHistory.class);
    }

	@Override
	public List<PaiementHistory> listPaiementHistoryByPay(Long paiementId) {
		return getSession().createQuery("FROM PaiementHistory p WHERE p.paiementId=" + paiementId).list();
	}

}
